import jfRequest from "../../index";
// import { IResultType } from "types/request";
import LocalCache from "@/utils/cache";

// 获取规则说明
export function getRuleDesc(ruleName: any) {
  const orgCode = LocalCache.getCache("orgCode");
  return jfRequest.get<any>({
    url: `/api/v1/patrol/base/getRuleDesc?ruleName=${ruleName}`,
    params: { orgCode: orgCode },
  });
}

// 获取扣分细则
export function queryBehavior(data: any) {
  const orgCode = LocalCache.getCache("orgCode");
  return jfRequest.post<any>({
    url: `/api/v1/patrol/behavior/queryBehavior`,
    params: { ...data, orgCode: orgCode },
  });
}

// 分页查询班级巡检得分
export function queryInspectionList(data: any) {
  const orgCode = LocalCache.getCache("orgCode");
  return jfRequest.post<any>({
    url: `/api/v1/patrol/inspection/list`,
    data: { ...data, orgCode: orgCode },
  });
}

// 巡检班级打分
export function addInspection(data: any) {
  const orgCode = LocalCache.getCache("orgCode");
  return jfRequest.post<any>({
    url: `/api/v1/patrol/inspection/addInspection`,
    data: { ...data, orgCode: orgCode },
  });
}

// 查询分类
export function queryCategory() {
  const orgCode = LocalCache.getCache("orgCode");
  return jfRequest.post<any>({
    url: `/api/v1/patrol/behavior/queryCategory`,
    data: { orgCode: orgCode },
    params: { orgCode: orgCode },
  });
}

// // 查询班级巡查得分
// export function queryInspectionScoreByClass(data: any) {
//   return jfRequest.post<any>({
//     url: `/api/v1/patrol/inspection/queryInspectionScoreByClass`,
//     data,
//   });
// }

// 查询班级巡查得分明细
export function queryInspectionScoreDetail(data: any) {
  const orgCode = LocalCache.getCache("orgCode");
  return jfRequest.post<any>({
    url: `/api/v1/patrol/inspection/queryInspectionScoreDetail`,
    data: { ...data, orgCode: orgCode },
  });
}

// 查询班级巡查得分明细
export function queryInspectionScoreByClass(data: any) {
  const orgCode = LocalCache.getCache("orgCode");
  return jfRequest.post<any>({
    url: `/api/v1/patrol/inspection/queryInspectionScoreByClass`,
    data: { ...data, orgCode: orgCode },
  });
}

// 查询班级巡查得分明细
export function inspectionExport(data: any) {
  const orgCode = LocalCache.getCache("orgCode");
  return jfRequest.post<any>({
    url: `/api/v1/patrol/inspection/export`,
    data: { ...data, orgCode: orgCode },
  });
}

// 获取班主任名称和编号
export function queryAllTeacher(data: any) {
  const orgCode = LocalCache.getCache("orgCode");
  return jfRequest.get<any>({
    url: `/api/v1/patrol/role/queryAllTeacher`,
    params: { ...data, orgCode: orgCode },
  });
}
